import 'package:json_annotation/json_annotation.dart';
import 'package:xbaistack/model/model.dart';

part 'generated/article.g.dart';

@JsonSerializable()
class Article extends Model<Article> {
  @override
  final String id;
  final String title;
  final String content;
  final int width;
  final int height;
  final String image;

  const Article({
    required this.id,
    required this.title,
    required this.content,
    required this.width,
    required this.height,
    required this.image,
  });

  factory Article.fromJson(Map<String, dynamic> json) => _$ArticleFromJson(json);

  Map<String, dynamic> toJson() => _$ArticleToJson(this);
}